<template>
  <div class="child">
    <h3>我是Child组件（儿）--{{ car.name }} --- {{ car.price }}</h3>
    <Son></Son>
  </div>
</template>

<script>
import Son from "@/components/Son";
import {inject} from "vue";

export default {
  name: "Child",
  components: {Son},
  setup() {
    let car = inject('car')
    console.log('child----')

    return {car}
  }
}
</script>

<style scoped>
.child {
  background-color: skyblue;
  padding: 10px;
}
</style>